import Vue from 'vue'
import '../../../src/core/lazyUse'
import 'regenerator-runtime/runtime'
import api from '@/api/apilist'
import echarts from 'echarts'
import commonFun from '../../../src/utils/common'
import '../../../src/utils/filter'
// 模拟函数 不实际请求接口
for (const i in api) {
  api[i] = jest.fn(() => Promise.resolve({ data: {} }))
}
jest.setTimeout(30000)
Vue.prototype.$commonFun = commonFun
Vue.prototype.$echarts = echarts
Vue.prototype.$api = api
Vue.config.productionTip = false // 它会阻止你显示显示生产模式的消息
window.matchMedia = window.matchMedia || function () {
  return {
    matches: false,
    addListener () { },
    removeListener () { }
  }
}
// 文件函数初始化
const resultBlob = new Blob([{ name: 'dsgdsgsdgdsg' }], { type: 'application/json' })
File.prototype.slice = jest.fn(() => { return resultBlob })
File.prototype.mozSlice = jest.fn(() => { return resultBlob })
File.prototype.webkitSlice = jest.fn(() => { return resultBlob })
